﻿Public NotInheritable Class VirtualControlOutput
    Implements IControlOutput

    Private m_parent As frmVirtualController

    Public Function MoveMouse(ByVal pt As System.Drawing.PointF) As Boolean Implements IControlOutput.MoveMouse
        If Not m_parent Is Nothing Then
            Return m_parent.VirtMoveMouse(pt)
        End If
    End Function

    Public Sub TypeString(ByVal k As String) Implements IControlOutput.TypeString

    End Sub

    Public Sub SetMouseButtonState(ByVal button As System.Windows.Forms.MouseButtons, ByVal state As Boolean) Implements IControlOutput.SetMouseButtonState
        If Not m_parent Is Nothing Then
            Select Case button
                Case MouseButtons.Left
                    m_parent.LeftButton = state

                Case MouseButtons.Right
                    m_parent.RightButton = state
            End Select

            m_parent.picVirtualScreen.Refresh()
        End If
    End Sub

    Public Property Parent() As frmVirtualController
        Get
            Return m_parent
        End Get
        Set(ByVal value As frmVirtualController)
            m_parent = value
        End Set
    End Property
End Class
